/* GUI CONVERTED from sosorp15.p (converter v1.75) Mon Sep 25 09:14:42 2000 */
/* sosorp15.p - -BOOKINGS HISTORY BY PART                                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert sosorp15.p (converter v1.00) Tue Sep 30 12:00:07 1997 */
/* web tag in sosorp15.p (converter v1.00) Mon Sep 29 14:35:40 1997 */
/*F0PN*/ /*K0LF*/ /*                                                       */
/*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 5.0    LAST EDIT: 01/16/89         BY: MLB *B013* */
/* REVISION: 6.0      LAST MODIFIED: 04/10/90   BY: ftb *D002* */
/* REVISION: 6.0      LAST MODIFIED: 10/19/90   BY: afs *D112* */
/* REVISION: 6.0      LAST MODIFIED: 12/02/90   BY: afs *D237*   rev only */
/* REVISION: 8.6      LAST MODIFIED: 10/06/97   BY: mur *K0LF* */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0K6* Rajinder Kamra*/
/* REVISION: 9.1      LAST MODIFIED: 09/21/00   BY: *N0NM* Annasaheb Rahane */

/* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE sosorp15_p_1 "Day/Week/Month"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp15_p_2 "Per Column"
/* MaxLen: Comment: */

/*N0K6
 * &SCOPED-DEFINE sosorp15_p_3 "Bookings figures in thousands"
 * /* MaxLen: Comment: */
 *N0K6*/

&SCOPED-DEFINE sosorp15_p_4 "Round to Thousands"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp15_p_5 "Show Gross Margin"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define new shared variable start like ro_start.
define new shared variable part like pt_part.
define new shared variable part1 like pt_part.
define new shared variable cust like tr_addr.
define new shared variable cust1 like tr_addr.
define new shared variable site like tr_site.
define new shared variable site1 like tr_site.
define new shared variable buyer like pt_buyer.
define new shared variable prod_line like pt_prod_line.
define new shared variable ptgroup like pt_group.
define new shared variable part_type like pt_part_type.
define new shared variable vendor like pt_vend.
define new shared variable pm_code like pt_pm_code.
define new shared variable dwm as character format "!(1)"
 label {&sosorp15_p_1}.
define new shared variable idays as integer format ">>>>>9" label {&sosorp15_p_2}.
define new shared variable show_profit like mfc_logical
 label {&sosorp15_p_5} initial "yes".
/*D112*/ define new shared variable round_1000 like mfc_logical
 label {&sosorp15_p_4} initial "no".

/*N0K6*/ define variable disp-bookings_fig as character no-undo.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
part           colon 15
   part1          label {t001.i} colon 49 skip
   cust           colon 15
   cust1          label {t001.i} colon 49 skip
   site           colon 15
   site1          label {t001.i} colon 49 skip(1)
   buyer          colon 22      start       colon 49
   prod_line      colon 22      dwm         colon 49
   ptgroup        colon 22      idays       colon 49
   part_type      colon 22
   vendor         colon 22
   pm_code        colon 22 skip(1)
   show_profit    colon 22
   round_1000     colon 22 skip(1)
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K0LF*/ {wbrp01.i}

/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

      if start = ? then start = today - (12 * 7) + 1.
      if dwm = "" then dwm = "W".
      if idays = 0 or idays = ? then idays = 1.
      if part1 = hi_char then part1 = "".
      if cust1 = hi_char then cust1 = "".
      if site1 = hi_char then cust1 = "".

/*K0LF*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0LF*/ {wbrp06.i &command = update &fields = "  part part1 cust cust1 site site1
buyer prod_line ptgroup part_type vendor pm_code show_profit round_1000 start dwm idays" &frm = "a"}

/*K0LF*/ if (c-application-mode <> 'web') or
/*K0LF*/ (c-application-mode = 'web' and
/*K0LF*/ (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i part}
      {mfquoter.i part1}
      {mfquoter.i cust}
      {mfquoter.i cust1}
      {mfquoter.i site}
      {mfquoter.i site1}
      {mfquoter.i buyer}
      {mfquoter.i prod_line}
      {mfquoter.i ptgroup}
      {mfquoter.i part_type}
      {mfquoter.i vendor}
      {mfquoter.i pm_code}
      {mfquoter.i show_profit}
      {mfquoter.i round_1000}
      {mfquoter.i start}
      {mfquoter.i dwm}
      {mfquoter.i idays}

      if part1 = "" then part1 = hi_char.
      if cust1 = "" then cust1 = hi_char.
      if site1 = "" then site1 = hi_char.

      if index("dwmp",dwm) = 0 then do:
     {mfmsg.i 14 3}
     /* "INTERVAL MUST BE (D)ay (W)eek OR (M)onth.  Please re-enter.". */

/*K0LF*/ if c-application-mode = 'web' then return.
else /*GUI NEXT-PROMPT removed */
     /*GUI UNDO removed */ RETURN ERROR.
      end.

/*K0LF*/ end.
      /* SELECT PRINTER OPTION*/
      
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:


        {hksimsg.i site site1}      /*fdn*/

      /*D112*/ FORM /*GUI*/ 
/*N0K6 {&sosorp15_p_3} */
/*N0K6*/ disp-bookings_fig no-label format "x(40)"
      with STREAM-IO /*GUI*/  frame footer page-bottom width 80. /* WIDTH ADDED*/

      /* SET EXTERNAL LABELS */
/*N0NM* setFrameLabels(frame footer:handle). */
/*N0K6*/ assign disp-bookings_fig:screen-value in frame footer =
                    getTermLabel("BOOKINGS_FIGURES_IN_THOUSANDS",40).
      if round_1000 then view frame footer.

      {mfphead.i}

      {gprun.i ""hksorp15a.p""}

      
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

      hide message no-pause.
      {mfmsg.i 9 1}

end.

/*K0LF*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" part part1 cust cust1 site site1 buyer prod_line ptgroup part_type vendor pm_code show_profit round_1000 start dwm idays "} /*Drive the Report*/
